//接口统一配置
import axios from "axios";
//后端地址
const API_HOST = 'http://localhost:8000/'
//
const instance = axios.create({
    baseURL: API_HOST,
    timeout: 10000,
    headers: { 'Content-Type': 'application/json' },
    // withCredentials: true
});
//测试接口
export const testAPI = (payload) => instance.post('/something/', payload);
//请求用户初始信息
export const getUserInfo = (payload) => instance.post('/virtual_scene/user_info/', payload);
//请求基站初始信息
export const getStationInfo = (payload) => instance.post('/virtual_scene/bs_info/', payload);
//请求优化结果
export const getOptimizedResult = (payload) => instance.post('/virtual_scene/final_res/', payload);
//设置仿真参数
export const changeSettings = (payload) => instance.post('/virtual_scene/set_para/', payload);
//修改真实基站数据
export const changeRealBs = (payload) => instance.post('/real_station/', payload);
//修改单个基站仿真参数
export const changeSingleStation = (payload) => instance.post('/virtual_station/single_bs/', payload);
//修改多个基站仿真参数
export const changeStation = (payload) => instance.post('/virtual_station/multiple_bs/', payload);
//修改寄存器充放电数据
export const changeCharge = (payload) => instance.post('/virtual_station/Pv_Data_Change/', payload);
//获取光伏功率、逆变器功48小时内数据
export const getEchartData = (payload) => instance.post('/virtual_station/power_graph/', payload);
